package com.neusoft.nep.admin.controller;

import com.neusoft.nep.admin.entity.Feedback;
import javafx.fxml.FXML;
import javafx.scene.control.TextField;
import javafx.stage.Stage;

public class AssignFeedbackViewController {
    private Stage dialog;
    private Feedback feedback;
    @FXML
    private TextField id;
    @FXML
    private TextField message;
    @FXML
    private TextField telephone;
    @FXML
    private TextField address;
    @FXML
    private TextField details;
    @FXML
    private TextField AQI;
    @FXML
    private TextField date;
    public void setDialog(Stage dialog) {
        this.dialog = dialog;
    }
    public void back(){
        dialog.close();
    }
    public Feedback getFeedback() {
        return feedback;
    }
    public void setData(Feedback feedback) {
        this.feedback = feedback;
        id.setText(String.valueOf(feedback.getId()));
        message.setText(feedback.getName()+feedback.getSex()+feedback.getBornDate());
        telephone.setText(feedback.getTelephone());
        address.setText(feedback.getProvince()+feedback.getCity());
        details.setText(feedback.getDetails());
        AQI.setText(String.valueOf(feedback.getAQI()));
        date.setText(String.valueOf(feedback.getDate()));
    }
}
